<%@ page language="java" contentType="text/html; charset=UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
	<head>
		<link href="/SCMDB/style/main.css" rel="stylesheet" type="text/css" />
		<script type="text/javascript" src="/SCMDB/js/Super.js"></script>
		<s:include value="../commonPage/message.jsp" />
	</head>
	<script>
		function setUp(){
			var refreshTime = document.getElementById("refreshTime").value
			window.location.href="/SCMDB/empReportAction!setUp.action?refreshTime="+refreshTime+"&isUsed=1";
		}
		function cancel(){
			var refreshTime = document.getElementById("refreshTime").value
			window.location.href="/SCMDB/empReportAction!cancel.action?isUsed=0";
		}
	</script>
	<body>
		<div class="main">
			<s:form action="empReportAction!findUpload.action" method="post"
				theme="simple"><fieldset class="fieldSearch">
					<legend>考勤上传设置</legend>
				<table border="0" cellspacing="0" cellpadding="0">
				<tr>
				<td align="right" class="p_8">自动上传时间：</td>
				<td><input id="refreshTime" type="text" class="sInput" value="<%=request.getAttribute("refreshTime") %>" />（单位：秒）</td>
				<td align="right" class="p_14" colspan="2">
				<p class="pEdit">
				<%
					String isUsed = (String)session.getAttribute("isUsed");
					if(isUsed.equals("1")){
					%>
					<input name="upload" type="button" class="bAdd" value="上传" onclick="setUp();" disabled="disabled"/>
					<input name="cancelUpload" type="button" class="bAdd" value="取消" onclick="cancel();" />
					<%}else{ %>
					<input name="upload" type="button" class="bAdd" value="上传" onclick="setUp();"/>
					<input name="cancelUpload" type="button" class="bAdd" value="取消" onclick="cancel();"  disabled="disabled"/>
					<%}
				%>
				</p></td>
				</tr>
				</table>
				</fieldset>
				<table border="0" cellpadding="1" cellspacing="1" class="tableList">
					<thead>
						<tr>
							<th>
								自动上传时间
							</th>
							<th>
								最后一次上传时间
							</th>
							<th>
								状态
							</th>
						</tr>
					</thead>
					<tbody>
						<tr>
							<td>
								<%=request.getAttribute("refreshTime") %>秒
							</td>
							<td>
								<%=request.getAttribute("lastTime") %>
							</td>
							<td>
								<%=request.getAttribute("state") %>
							</td>
						</tr>
					</tbody>
				</table>
			</s:form>
		</div>
	</body>
</html>
